<template>
    <div class="safetyWrap">
        <div class="safetyBox">
            <h4 class="safetyTit">数量：{{listAllCount}}</h4>
            <noData v-if="listAllCount == 0"></noData>
            <group>
                <cell :title="(item.ProjectName)"
                      :border-intent="true"
                      class="safetyCell"
                      v-for="(item,index) in cellList"
                      :key="index"
                      is-link
                      value-align="left"
                      @click.native="markMore(item)">
                    <span class="safetydate">{{item.CheckDate}}</span>
                </cell>
            </group>
        </div>
        <myMenu></myMenu>
    </div>
</template>
<script>
import myMenu from '@/commonComponents/menu'
export default {
    name: 'safetyScore',
    components: {
        myMenu
    },
    data () {
        return {
            userInfo: {}, // 用户信息
            listAllCount: 0, // 总数
            cellList: []// 安全检查评分列表
        }
    },
    created () {
        this.$vux.loading.show({
            text: 'Loading'
        })
        this.userInfo = JSON.parse(localStorage.getItem('userInfo'))
        this.getData()
    },
    methods: {
        getData () {
            var that = this
            var params = {
                'allowPaging': true,
                'business': 'GetWaitingCheckWorkScroe',
                'pageIndex': 0,
                'pageSize': 20,
                'tokenId': '',
                'userId': this.userInfo.userid
            }
            this.$axiosAjax.getConfigJson(params)
                .then((res) => {
                    // console.log(res)
                    if (res.data.code == 0) {
                        that.cellList = res.data.data
                        that.listAllCount = res.data.count
                    } else {
                        this.$vux.toast.text(res.data.info)
                    }
                }).catch(() => {

                }).finally(() => {
                    this.$vux.loading.hide()
                })
        },
        markMore (item) {
            this.$store.state.scores = 0.0
            this.$router.push({ path: '/markDetail', query: { CheckWorkId: item.CheckWorkId } })
        }

    }
}
</script>
<style scoped>
.safetyWrap {
    background: #ebeef2;
}
.safetyBox {
    background: #fff;
    border-radius: 10px;
    /* padding: 0 20px; */
}
.safetyTit {
    height: 40px;
    line-height: 40px;
    color: #2269ff;
    text-align: right;
    padding-right: 20px;
    font-size: 14px;
    border-bottom: 1px solid #f5f5f5;
}
.safetyCell {
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    font-size: 13px;
}
.safetydate {
    float: right;
    height: 55px;
    line-height: 55px;
    color: #666;
}
</style>
<style>
.safetyBox .weui-cells {
    margin-top: 0;
}
.safetyBox .vux-no-group-title {
    margin-top: 0;
}
.safetyBox .weui-cells:before,
.safetyBox .weui-cells:after {
    display: none;
}
.safetyBox .safetyCell:last-child::after {
    content: ' ';
    position: absolute;
    left: 0;
    bottom: 0;
    right: 0;
    height: 1px;
    border-top: 1px solid #d9d9d9;
    color: #d9d9d9;
    -webkit-transform-origin: 0 0;
    transform-origin: 0 0;
    -webkit-transform: scaleY(0.5);
    transform: scaleY(0.5);
    left: 4vw;
}
.safetyWrap .vux-label {
    font-size: 14px;
    color: #333;
}
.safetyWrap .safetydate {
    font-size: 14px;
    color: #999;
}
</style>
